/* 虚拟列表样式 */

.virtual-list {
  position: relative;
  overflow: auto;
  will-change: scroll-position;
}

.virtual-list::-webkit-scrollbar {
  width: 8px;
}

.virtual-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.virtual-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.virtual-list::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.virtual-list-content {
  position: relative;
  width: 100%;
  pointer-events: none;
}

.virtual-list-content > * {
  pointer-events: auto;
}

/* 虚拟列表项动画 */
.virtual-list-item {
  transition: transform 0.1s ease-out;
}

.virtual-list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 性能优化：减少重绘 */
.virtual-list-item {
  contain: layout style paint;
  transform: translateZ(0);
}

/* 滚动指示器 */
.virtual-list-scroll-indicator {
  position: absolute;
  top: 10px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.virtual-list.scrolling .virtual-list-scroll-indicator {
  opacity: 1;
}

/* 加载状态 */
.virtual-list-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #666;
  font-size: 14px;
}

.virtual-list-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #e8e8e8;
  border-top: 2px solid #1890ff;
  border-radius: 50%;
  animation: virtual-list-spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes virtual-list-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 空状态 */
.virtual-list-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #999;
  font-size: 14px;
}

.virtual-list-empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* 性能调试模式样式 */
.virtual-list-debug {
  position: relative;
}

.virtual-list-debug::after {
  content: attr(data-debug-info);
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(255, 255, 0, 0.9);
  color: black;
  padding: 4px 8px;
  font-size: 12px;
  font-family: monospace;
  border-radius: 0 0 4px 0;
  z-index: 1001;
  pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .virtual-list::-webkit-scrollbar {
    width: 6px;
  }
  
  .virtual-list-scroll-indicator {
    font-size: 11px;
    padding: 3px 6px;
  }
}